package org.qqcui.designpattern.patterns.memorandum.simple;

/**
 * 存储状态的原始类
 *
 * @author cuiqingqiang
 * @version 1.0
 * @date 2022/5/7 10:16
 **/
public class Originator {

    private String state;

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public Memento saveStateMemento() {
        return new Memento(state);
    }

    public void getStateFromMemento(Memento memento) {
        this.state = memento.getState();
    }
}
